import { createApp } from 'vue'
import {createPinia} from 'pinia';
import App from './App.vue'
import router from './router/index'


// 1.引入element-plus组件
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import piniaPersist from 'pinia-plugin-persist'


const app = createApp(App)
const pinia = createPinia()
pinia.use(piniaPersist)
app.use(router)
    // 2.挂载element-plus组件
    .use(ElementPlus)
    .use(pinia)
    .mount('#app')

// 3.使用element-plus组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
